from ebl_pattern_writer import point, shape, field, bar
fld=field(600)

width=4400; #nm
lengthstart=8000; #nm
lengthstep=4000#nm
lengthend=40000#nm
ystart=0#nm
ystep=70000#nm
yend=600000#nm
xstep=width+40000#nm

shapes=[]

for y in range(ystart,yend,ystep):
    for length in range(lengthstart,lengthend+1,lengthstep):
        x=(length-lengthstart)/lengthstep*xstep
        shapes.append(bar(width,length).translate(width/2,length/2).translate(x,y))

fld.shapelists.append(shapes)
fld.writexmldom('wg_2011_06_30')
print 'written wg_2011_06_30.xml'